import presetWeapp from 'unocss-preset-weapp';
import { extractorAttributify, transformerClass } from 'unocss-preset-weapp/transformer';
import { defineConfig } from 'unocss';

// 可以写属性会自动增加class,也可以写class
const prefix = '';
const { presetWeappAttributify, transformerAttributify } = extractorAttributify({
  classPrefix: prefix,
});

export default defineConfig({
  presets: [
    // https://github.com/MellowCo/unocss-preset-weapp
    presetWeapp({ prefix }),
    // attributify autocomplete
    presetWeappAttributify(),
  ],
  theme: {
    colors: {
      primary: '#b696e6',
      hot: '#e93534',
      pink: '#fa86a7',
      gray: '#cccccc',
    },
  },
  shortcuts: [
    {
      center: 'flex justify-center items-center',
    },
    {
      'card-modal': 'b-rounded b-transparent bg-white px-12rpx py-12rpx',
    },
    {},
  ],
  transformers: [
    // https://github.com/MellowCo/unocss-preset-weapp/tree/main/src/transformer/transformerAttributify
    transformerAttributify(),

    // https://github.com/MellowCo/unocss-preset-weapp/tree/main/src/transformer/transformerClass
    transformerClass(),
  ],
});
